#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int count = 0;

    for (int i = 1; i <= 2019; ++i) 
    {
        int num = i;
        while (num > 0) 
        {
            int digit = num % 10;
            if (digit == 9) 
            {
                ++count;
                break;
            }
            num /= 10;
        }
    }
    printf("%d\n", count);
    return 0;
}
